#ifndef WIFI_H
#define WIFI_H

#include <QWidget>
#include "jwidget/jdialog.h"
#include <QDialog>
#include "InputMethod/inputmethod.h"
#include "configargs.h"

 extern   QLineEdit   *DipWifi;

extern "C" {

#include "dirent.h"
#include <cstdio>
#include <unistd.h>
#include "wpa_ctrl.h"
}


QT_BEGIN_NAMESPACE
class QLineEdit;
QT_END_NAMESPACE

class WifiSeting : public JDialog
{
    Q_OBJECT
 public:
     WifiSeting(QWidget *parent = 0);
    ~WifiSeting();
    InputMethod *im;
      QListWidget * listWidget;
       QList<QString> keytmp;


private slots:

     void slotSaveData();
     void slotDTHIPButton();
     void createImConnect(QString ObjName);
     void wifiLink();
     void chosewifi();
     void wifiScan();
     void refreshLabelPos();
     void forgetPasswd();

public slots:
     void scanRequest();
     char * scan();
     void receiveMsgs();
     void openwpa();
     void slotZTimeGetDTIp();

private:

    QLineEdit       *qlineedit_ip;
    QLineEdit       *qlineedit_keytype;
    QLineEdit       *qlineedit_mask;
    QLineEdit       *qlineedit_gw;
    QLineEdit       *qlineedit_dns;
    QLineEdit       *linkStat;
    QLineEdit       *qlineedit_wifiname;
    QLineEdit       *qlineedit_wifikey;
    QSplitter       *pwifisplitter;
    QListView       *pwifilistView;
    QTimer          *timerwifi66;
    QTimer*m_pTimer;
    int wificount;
    int signallevel[64];
    int wifigetdtipcount;
};

class Wifipassword : public QDialog
{
    Q_OBJECT
 public:
     Wifipassword(QWidget *parent = 0);
    ~Wifipassword();
    InputMethod *im2;
     QSlider         *qsignallevelQSlider;
     int ctrlRequest(const char *cmd, char *buf, size_t *buflen);
private slots:
     void linkButtonWifiFun();
     void createImConnect2(QString ObjName);
     char * connectB();
     char * disconnectwifi();
     void saveConfig();
     void selectNetwork( );
    // void addNetwork();
    //  void selectNetwork( const QString &sel );
private:
    QLineEdit       *qlineedit_password;

    QPushButton     *qlinkButton;
    QPushButton     *qcloseButton;
    QLabel          *qlinkLabel;
    QLabel          *qsignallevelLabel;
    QLabel*giflabel;
    QLabel*giflabelt;
};

class Wifilian : public QDialog
{
    Q_OBJECT
 public:
    Wifilian(QWidget *parent = 0);
   ~Wifilian();
    int wifilianflag;
    int flagcount;
private:
    QLabel*giflabel;
    QLabel*giflabelt;
private slots:
    void wifitime();

};

#endif // NET_GUI_H

